#include <iostream>
#include <math.h>
#include <bitset>

using namespace std;

int N, c1;

int GCD(int u, int v)
{
    if (v == 0) return u;
    return (GCD(v, u%v));
}

void process()
{
    c1 = 0;
    bitset<1000001> found;
    for (int j = 1; j <= (int)sqrt((double)N)+1; j++)
        for (int i = 1; i < j; i++)
        {
            int c = j*j+i*i;
            if (c > N) break;
            if (((i^j) & 1) == 1 && GCD(i, j) == 1)
            {
                c1++;
                int a = j*j-i*i, b = 2*i*j, a1 = 0, b1 = 0, c1 = 0;
                for (int k = 1; k*c <= N; k++)
                {
                    a1 += a;
                    b1 += b;
                    c1 += c;
                    found[a1] = 1;
                    found[b1] = 1;
                    found[c1] = 1;
                }
            }
        }

    cout << c1 << " " << N - found.count() << endl;
}

int main()
{
    while (cin >> N) process();
    return 0;
}
